.plugin-common-hidden {
    display: none !important;
}

.plugin-common-readonly {
    pointer-events: none;
    opacity: 0.5;
}

.plugin-common-readonly .control-left {
    text-decoration: line-through;
}

#form {
    box-sizing: border-box;
    width: 100%;
    font-size: 14px;
    color: rgb(65, 84, 98);
    font-family: "Open Sans", "Clear Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

#form ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
    background: transparent;
}

#form ::-webkit-scrollbar-track {
    border-radius: 0;
}

#form ::-webkit-scrollbar-thumb {
    background: #BBB;
    transition: all .2s;
    border-radius: 8px;
}

#form ::-webkit-scrollbar-thumb:hover {
    background-color: rgba(95, 95, 95, 0.7);
}

/***** explain *****/
.explain {
    color: #999;
    font-size: 12px;
    line-height: 12px;
}

/***** tooltip *****/
.tooltip {
    position: relative;
    display: inline-block;
    margin-left: 4px;
}

.tooltip > span:first-child {
    font-size: 13px;
    color: #98989D;
    margin-left: 2px;
    cursor: pointer;
}

.tooltip > span:last-child {
    display: none;
    position: absolute;
    top: 30px;
    left: -50px;
    background-color: rgba(0, 0, 0, 0.65);
    color: #FFF;
    padding: 8px 12px;
    z-index: 10;
    border-radius: 6px;
    width: max-content;
    line-height: 24px;
    max-width: 300px;
    word-wrap: break-word;
}

.tooltip > span:last-child::after {
    content: '';
    width: 0;
    height: 0;
    position: absolute;
    border-bottom: 6px solid rgba(0, 0, 0, 0.65);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    top: -6px;
    left: 50px;
}

.tooltip:hover > span:first-child {
    border-color: #0A84FF;
    color: #0A84FF;
}

.tooltip:hover > span:last-child {
    display: block;
}

/***** box *****/
.box-container {
    padding: 5px 0;
}

.box {
    padding: 5px 0;
    background: #FFF;
    border-radius: 8px;
}

/***** title *****/
.title {
    font-weight: bold;
    display: flex;
    align-items: center;
    height: 42px;
    line-height: 42px;
    user-select: none;
}

/***** general control *****/
.control {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    min-height: 24px;
    line-height: 32px;
}

.control-left {
    flex: 1;
    word-break: keep-all;
    padding-right: 12px;
    max-width: 100%;
    user-select: none;
}

.control-right {
    display: flex;
    align-items: center;
    font-size: 16px;
}

.control[data-type="text"] > .control-right,
.control[data-type="number"] > .control-right,
.control[data-type="hotkey"] > .control-right,
.control[data-type="color"] > .control-right,
.control[data-type="unit"] > .control-right,
.control[data-type="range"] > .control-right {
    width: 240px
}

input[type="text"],
input[type="number"],
textarea {
    box-sizing: border-box;
    margin: 0;
    padding: 1px 8px;
    line-height: 2;
    list-style: none;
    position: relative;
    display: inline-block;
    border: 1px solid rgba(150, 162, 170, 0.4);
    border-radius: 4px;
    background: transparent;
    width: 100%;
    min-height: 2em;
    font-size: 16px;
    outline: none;
    font-family: inherit;
    color: inherit;
}

textarea {
    resize: vertical;
    color: inherit;
    font-size: 14px;
    line-height: 24px;
}

input::placeholder,
textarea::placeholder {
    color: rgba(60, 60, 67, 0.6);
}

.text-input:disabled,
.number-input:disabled,
.hotkey-input:disabled,
.unit-input:disabled,
.color-input:disabled,
.switch-input:disabled {
    cursor: not-allowed;
}

.no-resize {
    resize: none;
}

/***** switch *****/
.switch-input {
    appearance: none;
    -webkit-appearance: none;
    display: inline-block;
    width: 43px;
    height: 26px;
    position: relative;
    background-color: #DCDFE6;
    outline: none;
    border: 0;
    border-radius: 16px;
    background-clip: content-box;
    margin: 0;
    user-select: none;
    cursor: pointer;
}

.switch-input::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: #FFF;
    border-radius: 50%;
    left: 3px;
    top: 0;
    bottom: 0;
    margin: auto;
    transition: .3s;
}

.switch-input:checked {
    background-color: #0A84FF;
    transition: .6s;
}

.switch-input:checked::before {
    left: 20px;
    transition: .3s;
}

/***** select *****/
.select {
    position: relative;
}

.select-wrap {
    display: flex;
    align-items: center;
    text-align: right;
    border-radius: 6px;
    border: 1px solid transparent;
    padding: 2px 8px;
    line-height: 25px;
    cursor: pointer;
    user-select: none;
}

.select-wrap:hover {
    border: 1px solid rgba(150, 162, 170, 0.4);
}

.select-icon {
    margin-left: 8px;
    transition: transform .3s;
}

.select:has(.option-box:not(.plugin-common-hidden)) .select-icon {
    transform: rotate(180deg);
}

.option-box {
    position: absolute;
    top: 24px;
    right: 0;
    background: #FFF;
    z-index: 10;
    padding: 6px;
    border-radius: 6px;
    border: 1px solid rgba(150, 162, 170, 0.4);
    box-shadow: 2px 2px 4px #DBDBDB, -2px -2px 4px #DBDBDB;
    max-height: 250px;
    overflow-y: auto;
    user-select: none;
}

.option-item {
    white-space: pre;
    padding: 0 6px 0 24px;
    border-radius: 4px;
    height: 24px;
    line-height: 24px;
    position: relative;
}

.option-item:hover {
    color: #FFF;
    background: #0A84FF;
}

.option-item[data-choose="true"]::before {
    content: "\2713";
    position: absolute;
    left: 6px;
}

/***** hotkey *****/
.hotkey-wrap {
    position: relative;
    flex-grow: 1;
    transition: all .3s;
    border-radius: 4px;
    outline: 1px solid transparent;
}

.hotkey-btn {
    position: absolute;
    display: inline-flex;
    flex-direction: row-reverse;
    justify-content: space-between;
    align-items: center;
    top: 50%;
    transform: translateY(-50%);
    right: 0;
    line-height: 1em;
    margin: 0 5px;
}

.hotkey-btn > div {
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
}

.hotkey-btn > .hotkey-reset:hover {
    background-color: #eee;
}

.hotkey-reset {
    display: none;
    font-size: 24px;
    color: #D70015;
}

.hotkey-input:not(:placeholder-shown) + .hotkey-btn > .hotkey-reset {
    display: block;
}

/***** unit *****/
.unit-wrap {
    width: 100%;
    display: inline-flex;
    border: 1px solid rgba(150, 162, 170, 0.4);
    border-radius: 4px;
}

.unit-wrap .unit-input {
    flex-grow: 1;
    width: 0;
    border: 0;
}

.unit-wrap .unit-value {
    display: inline-flex;
    align-items: center;
    color: rgba(60, 60, 67, 0.6);
    margin-right: 8px;
    user-select: none;
}

/***** range *****/
.range-wrap {
    display: inline-flex;
    flex-grow: 1;
}

.range-value {
    display: inline-flex;
    flex-direction: row-reverse;
    align-items: center;
    width: 2.4em;
    user-select: none;
}

.range-input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    display: flex;
    align-items: center;
    background-color: transparent;
    flex-grow: 1;
    margin: 0;
    padding: 0;
    outline: 0;
    border: 0;
}

.range-input[type="range"]::-webkit-slider-runnable-track {
    height: 3px;
    background: #F1F1F1;
    border-radius: 10px;
}

.range-input[type="range" i]::-webkit-slider-container {
    height: 20px;
    overflow: hidden;
}

.range-input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background-color: #1A73E8;
    margin-top: -5px;
    cursor: pointer;
}

/***** color *****/
.color-wrap {
    flex: 1;
    position: relative;
    height: 35px;
}

.color-display {
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    pointer-events: none;
    color: white;
    mix-blend-mode: difference;
    opacity: 0.8;
}

.color-input[type="color"] {
    -webkit-appearance: none;
    width: 100%;
    height: 100%;
    padding: 0;
    border: none;
    border-radius: 4px;
}

.color-input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-input[type="color"]::-webkit-color-swatch {
    border: 1px solid rgba(150, 162, 170, 0.4);
    border-radius: 4px;
}

/***** action *****/
.action {
    font-size: 22px;
    margin-right: 8px;
    transition: all .3s;
}

.control[data-type="action"] {
    cursor: pointer;
    overflow: hidden; /* Hides the ripple outside the element */
    position: relative; /* Allows absolute positioning of the ripple */
}

.control[data-type="action"]:hover {
    background-color: rgba(77, 66, 86, 0.08);
}

.control[data-type="action"]:hover .action {
    margin-right: 0;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(187, 187, 187, 0.5);
    transform: scale(0);
    animation: ripple-effect .8s ease-out forwards;
    pointer-events: none;
}

@keyframes ripple-effect {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    75% {
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/***** object *****/
.object-wrap {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.object-confirm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    width: fit-content;
    min-width: 68px;
    padding: 0 8px;
    margin-top: 8px;
    margin-left: auto;
    border-radius: 4px;
    border: 0;
    outline: 0;
    background-color: #007AFF;
    color: #FFF;
    transition: background-color .2s;
    cursor: pointer;
    user-select: none;
    font: inherit;
}

.object-confirm:hover {
    background-color: #0055B2;
}

/***** array *****/
.array {
    display: flex;
    flex-wrap: wrap;
}

.array > .array-item,
.array > .array-item-input,
.array > .array-item-add {
    display: inline-flex;
    align-items: center;
    padding: 0 6px;
    border-radius: 6px;
    font-size: 15px;
    margin: 0 5px 5px 0;
    border: 1px solid rgba(150, 162, 170, 0.4);
}

.array .array-item-add {
    cursor: pointer;
    border-style: dashed;
    font-size: 14px;
}

.array-item-add:hover {
    background-color: #eee5;
}

.array-item {
    transition: all .3s;
}

.array-item-input {
    min-width: 60px;
    outline: 1px solid #F9C67F;
}

.array-item-delete {
    display: inline-flex;
    align-items: center;
    margin-left: 5px;
    cursor: pointer;
    padding: 3px;
    color: #D70015;
    font-size: 18px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.array-item-delete:hover {
    background-color: #eee;
}

/***** table *****/
.table table {
    width: 100%;
    text-align: left;
    table-layout: fixed;
}

.table th,
.table td {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 15px;
}

.table th:last-child,
.table td:last-child {
    text-align: right;
    width: 65px;
}

.table th:last-child .fa,
.table td:last-child .fa {
    font-size: 19px;
    cursor: pointer;
    border-radius: 50%;
    padding: 7px;
    width: 18px;
    text-align: center;
}

.table .fa:hover {
    background-color: rgba(31, 31, 31, .08);
}

/***** radio, check *****/
.radio,
.checkbox {
    width: 100%;
}

.radio-option,
.checkbox-option {
    display: flex;
    align-items: center;
}

.radio-wrapper,
.checkbox-wrapper {
    position: relative;
    display: inline-flex;
    cursor: pointer;
    margin-right: 10px;
    margin-left: 2px;
}

.radio-label,
.checkbox-label {
    flex: 1;
    overflow: hidden;
    cursor: pointer;
    user-select: none;
    display: inline-flex;
    align-items: center;
    height: fit-content;
    min-height: 32px;
}

.radio-input,
.checkbox-input {
    opacity: 0;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    width: 18px;
    height: 18px;
    outline: none;
    cursor: pointer;
}

.radio-disc,
.checkbox-square {
    width: 9px;
    height: 9px;
    background-color: transparent;
    border: 2px solid #FFF;
    box-shadow: 0 0 0 2px #0B57D0;
    transition: all .2s ease;
    transform-origin: center center;
}

.radio-disc {
    border-radius: 50%;
}

.radio-input:checked + .radio-disc,
.checkbox-input:checked + .checkbox-square {
    background-color: #0B57D0;
}

/***** hint *****/
.hint-wrap {
    flex: 1;
}

.hint-header {
    font-weight: bold;
    line-height: 1.8em;
}

.hint-detail {
    padding-top: 2px;
    line-height: 1.5em;
    font-size: 12px;
    color: #999;
}

/***** composite *****/
.control[data-type="composite"] {
    flex-direction: column;
    padding: 0 12px;
}

.control[data-type="composite"] > .control,
.control[data-type="composite"] > .sub-box-wrapper {
    width: 100%;
}

.sub-box-wrapper {
    border-left: 2px dashed #ccc;
}

.sub-box-wrapper .title {
    padding: 0 12px;
    font-weight: initial;
}

.sub-box-wrapper > .box-container {
    padding: 0;
    margin-bottom: 0;
}

.sub-box-wrapper > .box-container > .box {
    padding: 0;
}

.sub-box-wrapper > .box-container > .box > .control {
    padding-right: 0;
}

.sub-box-wrapper > .box-container > .box > .control[data-type="composite"] {
    padding-top: 0;
    padding-bottom: 0;
}

/***** custom *****/
.custom-wrap {
    flex: 1;
}

.custom-wrap table {
    border-collapse: collapse;
    font-size: 13px;
    line-height: 1.6em;
    width: 100%;
}

.custom-wrap tr {
    border-bottom: 1px solid rgba(150, 162, 170, 0.2);
}

.custom-wrap tbody tr:last-child {
    border-bottom: none;
}

.custom-wrap th,
.custom-wrap td {
    padding: .65em 2px .65em 2px;
}

.custom-wrap table tr:last-child th {
    padding-top: 0;
}

.custom-wrap table tr:last-child td {
    padding-bottom: 0;
}
